#ifndef _TEXTEDITOR_H_
#define _TEXTEDITOR_H_
#include <QPlainTextEdit>

class TextEditorMargine;

class TextEditor: public QPlainTextEdit
{
    Q_OBJECT
public:
    explicit TextEditor(QWidget* parent);
    virtual ~TextEditor();
    friend class TextEditorMargine;
public:
    virtual bool load(const QString& path);

public slots:
    virtual void del();
    virtual void uppercase();
    virtual void lowercase();
    virtual void capitalize();
    virtual bool reset();
    virtual void jump(int line, int col = 0);
    virtual void jumpOffset(int offset);
signals:
    void contentLoaded();
private slots:
    void highlightCurrentLine();
protected:
    void resizeEvent(QResizeEvent *e);
    QString path;
private:
    TextEditorMargine *_margine;
};

#endif
